package com.ruoyi.laiwu.controller;


import cn.dev33.satoken.annotation.SaIgnore;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.laiwu.domain.bo.LwAlarmBo;
import com.ruoyi.laiwu.service.ILwAlarmService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/notify")
public class NotifyController {

    private final ILwAlarmService iLwAlarmService;


    @PostMapping("alarm/subscription")
    @SaIgnore
    @Log(title = "森林防火同步告警", businessType = BusinessType.UPDATE)
    public R<Void> alarm(@RequestBody LwAlarmBo request){
//        JSONObject entries = JSONUtil.parseObj(request);
            iLwAlarmService.insertByBo(request);
        return R.ok();
    }
}
